<div id="featured"><div class="featuredContainer">	<?
	$today = date('Y-m-d');
	
	// First check for any featured announcements
	$sql = "SELECT * from transFeatured
			WHERE
			DateDisplayTill >= '$today' AND
			OnHomePage = 1";
	$result = mysql_db_query($dbname,$sql);
	if (mysql_num_rows($result)>0) {
		$row = mysql_fetch_assoc($result);
		$title = stripslashes($row[Title]);
		$body  = stripslashes($row[Body]);
		
		echo '<h1>News!</h1>';
		if (!empty($title)) {
			echo '<p><b>'.$title.'</b><br />';
		}
		echo $body.'</p>';
		
	} else {			// Get any Events, Conferences, Scholarships or State Trainings marked (onHome)		$sqlC = "SELECT TE.EID,TE.EventTitle,TE.EventLocation,TE.EventDesc,TE.EventURL,TE.DateStart,TE.DateEnd,C.CatName 
				FROM transEvents TE
				LEFT JOIN transCategories C ON C.CID = TE.ECat
				WHERE TE.Active = '1' AND TE.OnHome = 1";		$resultC = mysql_db_query($dbname,$sqlC);		$rows = mysql_num_rows($resultC);
		$i=0;		if ($rows>0) {			while ($value = mysql_fetch_assoc($resultC)) {
				$cIDArray[$i]        = $value[EID];
				$cCatArray[$i]       = $value[CatName];				$cTitleArray[$i]     = stripslashes($value[EventTitle]);				$cDescArray[$i]      = stripslashes($value[EventDesc]);
				$cLocationArray[$i]  = stripslashes($value[EventLocation]);
				$cURLArray[$i]       = $value[EventURL];
								$cDateStart = convertDateTime($value[DateStart]); 				$cDateEnd   = convertDateTime($value[DateEnd]); 
				
				$cDateStartArray[$i] = $cDateStart[0];
				$cDateEndArray[$i]   = $cDateEnd[0];												$i++;			}				$i=$i-1;			// Now select a random entry			$amount = count($cIDArray); // Number of entries total			srand((double)microtime()*1000000);			$randomConf = rand(1,($amount));			// Now display entry arrays[$randomConf-1];
			echo '<h1><a href="events.php">'.$cCatArray[$randomConf-1].'</a></h1>';						echo '<b><a href="events.php">'.$cTitleArray[$randomConf-1].'</a></b><br />';			echo "<span class=\"date\">".$cDateStartArray[$randomConf-1];			if (!empty($cDateEndArray[$randomConf-1]) && ($cDateEndArray[$randomConf-1] != '00 00, 0000')) {				echo " to ".$cDateEndArray[$randomConf-1];			}			echo "</span><br />\n";			//$confDesc = substr($cDescArray[$randomConf-1],0,225);			//if (strlen($confDesc)>=225) { $confDesc .= '...'; }			$confDesc = shortText($cDescArray[$randomConf-1],25);
			echo $confDesc.'<div style="height: 10px;"></div>';			echo '<b><a href="events.php">See more details &raquo;</a></b>';		} else {
		// Default Text		?>			<h1>News!</h1>			<p>The Transition Community Network site has been updated: broken links have 			been replaced, and new resources are being added.  Please check back frequently as 			new sites are added.</p>		<? } 
	}
	?>	</div></div> 